import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

import { ConfigProvider } from 'antd';

// import store from './store'
// 使用redux-thunk实现在redux中执行异步操作
// import store from './store-redux-thunk'

// 使用redux调试工具
// import store from './store-redux-devtools'

// 使用redux-saga实现在redux中执行异步操作
// import store from './store-redux-saga'

// reducer的拆分-简易
// import store from './store-split-simple'

// reducer的拆分-分组
import store from './store-split-group'

// //  使用自己定义的connect函数
// import {StoreContext} from './utils/redux-connect-common/context'
// // 使用自己定义的connect函数

// 使用react-redux库  
// https://cn.redux.js.org/faq/react-redux  
// https://react-redux.js.org/introduction/why-use-react-redux
import { Provider } from 'react-redux';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  // 修改antd主题
  <ConfigProvider theme={{token: {colorPrimary: 'pink'}}}>
    {/* 使用自己定义的connect函数 */}
    {/* <StoreContext.Provider value={store}>
      <App />
    </StoreContext.Provider> */}
    {/* 使用react-redux库 */}
    <Provider store={store}>
      <App />
    </Provider>
  </ConfigProvider>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
